package com.mtiiot.fstcpserver.fastdfs.core;

import java.io.IOException;
import java.net.InetSocketAddress;

public class StorageServer extends TrackerServer
{
  protected int store_path_index = 0;

  public StorageServer(String ip_addr, int port, int store_path)
    throws IOException
  {
    super(ClientGlobal.getSocket(ip_addr, port), new InetSocketAddress(ip_addr, port));
    this.store_path_index = store_path;
  }

  public StorageServer(String ip_addr, int port, byte store_path)
    throws IOException
  {
    super(ClientGlobal.getSocket(ip_addr, port), new InetSocketAddress(ip_addr, port));
    if (store_path < 0)
    {
      this.store_path_index = (256 + store_path);
    }
    else
    {
      this.store_path_index = store_path;
    }
  }

  public int getStorePathIndex()
  {
    return this.store_path_index;
  }
}